/**
 * 月嫂详情和公司详情
 */
const Mock = require('mockjs')

const img = [
    'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fww1.sinaimg.cn%2Fmw690%2F001M3Mcbly1gjvrssaex7j63n83n8kjp02.jpg&refer=http%3A%2F%2Fwww.sina.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1611919354&t=9d65fb759c1945e1242b51e0bf9a060f',
    'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3155998395,3600507640&fm=26&gp=0.jpg',
    'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201510%2F18%2F20151018172940_5etXi.jpeg&refer=http%3A%2F%2Fb-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1611919469&t=83461f38906839d3b52c2e7a51ed739a',
    'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1441836571,2166773131&fm=26&gp=0.jpg',
    'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3582194852,1481557220&fm=26&gp=0.jpg',
    'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fblog%2F202011%2F16%2F20201116144255_fbec6.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1611919644&t=7b51260d1f5500038fda227f06888cdb',
    'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2315146696,3189809923&fm=26&gp=0.jpg',
    'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201501%2F30%2F20150130004848_UTsAu.thumb.700_0.jpeg&refer=http%3A%2F%2Fb-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1611919699&t=e6dd0e941e8bc9a719aa0eccd11797a4',
    'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1074188057,1218579293&fm=26&gp=0.jpg',
    'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1950846641,3729028697&fm=26&gp=0.jpg',
    'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=347107276,1959396700&fm=11&gp=0.jpg',
    'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=289237221,199580710&fm=26&gp=0.jpg',
    'https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=false&word=%E5%A4%B4%E5%83%8F&step_word=&hs=0&pn=387&spn=0&di=213620&pi=0&rn=1&tn=baiduimagedetail&is=0%2C0&istype=0&ie=utf-8&oe=utf-8&in=&cl=2&lm=-1&st=undefined&cs=208155123%2C970589869&os=3884857991%2C203103760&simid=3441860545%2C171948184&adpicid=0&lpn=0&ln=30&fr=&fmq=1609327339494_R&fm=&ic=undefined&s=undefined&hd=undefined&latest=undefined&copyright=undefined&se=&sme=&tab=0&width=undefined&height=undefined&face=undefined&ist=&jit=&cg=head&bdtype=0&oriquery=%E5%A4%B4%E5%83%8F&objurl=https%3A%2F%2Fgimg2.baidu.com%2Fimage_search%2Fsrc%3Dhttp%3A%2F%2Fpic1.zhimg.com%2F50%2Fv2-1ae9b2bbc17daaeb0a5d12184063a30f_hd.jpg%26refer%3Dhttp%3A%2F%2Fpic1.zhimg.com%26app%3D2002%26size%3Df9999%2C10000%26q%3Da80%26n%3D0%26g%3D0n%26fmt%3Djpeg%3Fsec%3D1611919811%26t%3D552e6899171237ac252b2bfa98044028&fromurl=ippr_z2C%24qAzdH3FAzdH3Fooo_z%26e3Bziti7_z%26e3Bv54AzdH3Fq7jfpt5gAzdH3Fn8anncm8bAzdH3Fwgfoj6AzdH3Fmdbdb8b99&gsm=184&rpstart=0&rpnum=0&islist=&querylist=&force=undefined',
    'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1340127580,1407454083&fm=26&gp=0.jpg',
    'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1296984525,3378929106&fm=26&gp=0.jpg',
    'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3033361221,2752676077&fm=26&gp=0.jpg',
    'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2541308253,3190372927&fm=26&gp=0.jpg',
    'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1878145874,2802724191&fm=26&gp=0.jpg',
    'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2292908988,3239045523&fm=26&gp=0.jpg',
    'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1365983964,600966652&fm=26&gp=0.jpg'
]
const imgCompany = ['https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.tianzuobj.com%2Fuploadimg%2F2019101714121165.png&refer=http%3A%2F%2Fwww.tianzuobj.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1611920090&t=4692e07ef6ccec96b92239be107bdedf',
    'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3662101739,2673529586&fm=26&gp=0.jpg',
    'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3219895027,3254648408&fm=26&gp=0.jpg',
    'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=220274220,1652939896&fm=26&gp=0.jpg',
    'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=14016394,2810032202&fm=26&gp=0.jpg',
    'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3402053284,1303007704&fm=26&gp=0.jpg',
    'https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=d&word=%E5%AE%B6%E6%94%BF%E4%BF%9D%E6%B4%81&step_word=&hs=0&pn=117&spn=0&di=23870&pi=0&rn=1&tn=baiduimagedetail&is=0%2C0&istype=2&ie=utf-8&oe=utf-8&in=&cl=2&lm=-1&st=-1&cs=2600921699%2C4073199631&os=1315740406%2C4176217405&simid=4224201423%2C730445753&adpicid=0&lpn=0&ln=0&fr=&fmq=1609328066813_R&fm=result&ic=&s=undefined&hd=&latest=&copyright=&se=&sme=&tab=0&width=0&height=0&face=undefined&ist=&jit=&cg=&bdtype=0&oriquery=&objurl=https%3A%2F%2Fgimg2.baidu.com%2Fimage_search%2Fsrc%3Dhttp%3A%2F%2Fm.360buyimg.com%2Fn12%2Fjfs%2Ft2353%2F311%2F117713808%2F134117%2F243ba9b6%2F55f01c76Nfd34949f.jpg!q70.jpg%26refer%3Dhttp%3A%2F%2Fm.360buyimg.com%26app%3D2002%26size%3Df9999%2C10000%26q%3Da80%26n%3D0%26g%3D0n%26fmt%3Djpeg%3Fsec%3D1611920261%26t%3De7c38a62f590f33906653aea18ab151f&fromurl=ippr_z2C%24qAzdH3FAzdH3Ftpj4_z%26e3B31_z%26e3Bv54AzdH3F80dlmb0amm_z%26e3Bip4s&gsm=73&rpstart=0&rpnum=0&islist=&querylist=&force=undefined',
    'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fcbu01.alicdn.com%2Fimg%2Fibank%2F2018%2F212%2F201%2F9339102212_834919095.310x310.jpg&refer=http%3A%2F%2Fcbu01.alicdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1611920274&t=d977a4ac43e2eee74bfc5fa9c941b48f',
    'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2933246201,1770437404&fm=26&gp=0.jpg',
    'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fgaitaobao4.alicdn.com%2Ftfscom%2Fi3%2F1024226930%2FTB2yvWbXGi5V1BjSspiXXXGBFXa_%21%211024226930.jpg&refer=http%3A%2F%2Fgaitaobao4.alicdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1611920333&t=d01c94947ed4b7850a8053a586dcaf50',]
module.exports = {
    //  月嫂详情返回数据
    [`GET /app/details/maternity/:personal_id`](req, res) {
        // console.log(img);
        Mock.Random.extend({
            // 定义随机的标签数组
            constellations: ['做饭', '月子餐', '家庭保洁', '洗衣', '育婴护理', '照看孩子', '家教辅导', '育婴保健', '营养搭配', '照顾老人',],
            //自定义占位符名字tags
            skills: function (date) {
                //随机选择2个作为返回值
                //return this.pick(this.constellations, 2)
                //随机选择3-7个作为返回值
                return this.pick(this.constellations, 3, 7)
            },
            imags: img,
            imgs: function (date) {
                return this.pick(this.imags, 6)
            }
        })
        res.status(200).json(Mock.mock({
            massaeg: '获取月嫂详情成功',
            data: {
                "per_id|1-9999": 1,
                "per_name": '@cname(2-4)',
                "address|1": ['湖南长沙', '广东广州', '湖南娄底', '广东深圳', '陕西铜川', '山东淄博', '江苏徐州', '福建三明', '福建南平'],
                "experience|1": ['1年经验', '2年经验', '3年经验', '4年经验', '5年经验', '6年经验', '7年经验', '8年经验'],
                'company': '@city(true)@ctitle(3,4)公司',
                'profession|1': ['保姆  月嫂  育婴师  早教/托育', '保姆  月嫂  育婴师  养老/陪护', '保姆  月嫂  保洁/清洁  养老/陪护'],
                'skill': '@skills',
                'is_followed|1': false,
                'is_contacted|1': false,
                'resume': {
                    'content': '@cparagraph(3)',
                    'native_place|1': ['汉', '维吾尔族', '苗族', '土家族', '蒙古族', '回族'],
                    'attribute|1': ['鼠', '牛', '虎', '兔', '龙', '蛇', '马', '羊', '猴', '鸡', '狗', '猪',],
                    'constellation': '@cword(2)座',
                    'birthday': '@datetime(yyyy-MM-dd)',
                    'education|1': ['小学', '初中', '高中', '大专', '大学'],
                    'papers_img': "@imgs"
                }
            }
        }))
    },

    //  公司详情返回数据
    [`GET /app/details/company/:com_id`](req, res) {
        Mock.Random.extend({
            // 定义随机的标签数组
            constellations: [0, 1, 2, 3, 4, 5, 6, 7],
            //自定义占位符名字tags
            post: function (date) {
                //随机选择2个作为返回值
                //return this.pick(this.constellations, 2)
                //随机选择3-7个作为返回值
                return this.pick(this.constellations, 3, 7)
            },
            imags: img,
            imgs: function (date) {
                return this.pick(this.imags, 3)
            }
        })
        res.status(200).json(Mock.mock({
            message: '获取公司详情成功',
            'data': {
                'com_id|1-9999': 1,
                'com_name': '@province(true)@ctitle(3,4)有限公司',
                'address': '@county(true)@cword(4,7)写字楼',
                'post_scope': '@post()',
                'register|1-999': 1,
                'client|10-999': 1,
                'legal_person': '@cname(2-4)',
                'com_phone': /^073[0-9]-\d{8}/,
                'is_followed|1': false,
                'com_scale': '@integer(10,300)人以下',
                'com_introduce': '@cparagraph(8)',
                'com_banner': ['@image("100x74","@color()","#fff","png","banner")'],
                'com_photo': [{
                    'img': '@imgs',
                    'title': '公司资质',
                },
                {
                    'img': '@imgs',
                    'title': '公司环境',
                }, {
                    'img': '@imgs',
                    'title': '公司荣誉',
                }, {
                    'img': '@imgs',
                    'title': '团队风采',
                }],

            }
        }))
    },

    // 获取公司的注册人员 
    [`GET /app/details/register`](req, res) {
        res.status(200).json(Mock.mock({
            message: '获取成功',
            data: {
                'com_register|3-30': [{
                    'reg_id|1-999': 1,
                    'tag|1': [
                        { "experience|1": ['1年经验', '2年经验', '3年经验', '4年经验', '5年经验', '6年经验', '7年经验', '8年经验'], 'grade|1': ['一星育婴师', '二星育婴师', '二星育婴师', '三星育婴师', '四星育婴师', '五星育婴师', '金牌育婴师'] },
                    ],
                    'name': '@cname(2-4)',
                    'photo|1': img,
                    'aphorism': '@cword(10,15)'
                }]
            }
        }))
    },

}